/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.its.dsw2.view;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;

/**
 *
 * @author Piter
 */
@ManagedBean
@SessionScoped
public class AcessBean {
    private String user;
    private String password;

    /**
     * Creates a new instance of AcessBean
     */
    public AcessBean() {
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
     public String procesarAcion(){
        if(user.equals("piter")&&password.equals("123")){
             FacesContext context = FacesContext.getCurrentInstance();
          context.getExternalContext().getSessionMap().put("USUARIO_LOGUEADO", user);
        return "MenuPrincipal";
        }else{
            return "error";
        }
    }

}
